const BaseMapper = require('../../library/base-mapper');
const GameModel = require('../model/game')
const {Op} = require("sequelize");

class GameMapper extends BaseMapper{
    constructor() {
        super();
        this.model = GameModel
    }

    handleSearch(params, options) {
        if(params['name']){
            options.where['name'] = {
                [Op.substring]: params['name']
            }
        }
        super.handleSearch(params, options)
    }
}

module .exports = GameMapper